<template>
  <div class="main">
      <h1 class="title">{{productDetail.name}} <span @click="yuyuezixun">立即咨询</span></h1>
      <div class="content">
          <div class="detail">
            <h1>| 基本信息</h1>
            <p><span>保险公司：{{productDetail.company}}</span> <span>交款年限：{{productDetail.yearLimit}}</span></p>
            <p><span>认购货币：{{productDetail.currency}}</span> <span>金额限制：{{productDetail.moneyLimit}}</span></p>
            <p><span>保障年限：{{productDetail.insuranceYear}}</span> <span>产品特点：{{productDetail.feature}}</span></p>
          </div>
           <div class="detail">
            <h1>| 产品详情</h1>
            <div class="detailcontent" v-html="productDetail.detail">

            </div>
          </div>
      </div>
  </div>
</template>


<script>
import api from "../../../static/js/api.js";
import asyncApi from "../../../static/js/asyncApi.js";

export default {
  data() {
    return {

    };
  },

  components: {

  },
  methods: {
    yuyuezixun() {
      if (this.$store.state.nologin) {
        this.$alert("请登录后预约！");
      } else {
        api
          .contactUs({
            phone: this.$store.state.userinfo.mobile,
            name: "预约咨询"
          })
          .then(res => {
            if (res.code == 1) {
              this.$alert(res.msg);
            } else {
              this.$alert(res.msg);
            }
          });
      }
    }
  },
  mounted(){
    
  },
  async asyncData(context) {
    var id = parseInt(context.params.id);
    let [data1] = await Promise.all([
      asyncApi.getInsuranceDetail({ id: id }),
    ])
    return {
      productDetail: data1.data.data
    };
  },
  head () {
    return {
      title: '海外保险投资平台_海外保险_香港重疾险_人寿险_医疗险_储蓄分红险_海外保险网-天沁财富',
      meta: [
         { hid:"keywords",name: 'keywords', content: '海外保险,香港重疾险,人寿险,医疗险,储蓄分红险,海外保险产品,海外保险业务,海外保险网' },
         { hid:"description",name: 'description',  content: '天沁财富海外保险投资平台，为高净值群体提供全方位的海外保险配置服务，包括香港重疾险、人寿险、医疗险、储蓄分红险等海外保险' }
      ]
    }
  }
};
</script>

<style scoped>
.detailcontent{
  padding: 20px;
}
.main{
  width: 1200px;
  margin: 10px auto;
}
.title{
  width: 100%;
  height: 100px;
  line-height: 100px;
  box-sizing: border-box;
  padding: 0 20px;
  background: #cd9c54;
  color: white;
  display: flex;
  font-size: 36px;
  justify-content: space-between;
  align-items: center;
  box-shadow:0 0 10px #d5d5d5 inset;
}
.title span{
  height: 50px;
  width: 140px;
  background: white;
  color: black;
  font-size: 22px;
  line-height: 50px;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 200px;
}
.content{
  margin-top: 20px;
  background: white;
}
.detail{
  padding: 30px 20px 0;
  box-sizing: border-box;
}
.detail h1{
  height: 26px;
  line-height: 26px;
  font-size: 22px;
  font-weight: bolder;
  color: #333;
  margin-bottom: 24px;
}
.detail p{
  height: 36px;
  line-height: 36px;
}
.detail p span{
  width: 50%;
  display: inline-block;
  font-size: 18px;
}
</style>
